<!-- BEGIN PAGE CONTAINER-->
<div class="container-fluid">
<!-- BEGIN PAGE HEADER-->
<div class="row-fluid">
    <div class="span12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title">
            Quản lý khách hàng
        </h3>
        <ul class="breadcrumb">
            <li>
                <i class="icon-home"></i>
                <a href="/admin/shop/admin">Trang chủ</a>
                <i class="icon-angle-right"></i>
            </li>
            <li>
                <a href="/admin/customer/admin">Khách hàng</a>
                <i class="icon-angle-right"></i>
            </li>
            <li><a href="admin/customer/admin">Danh mục khách hàng</a></li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<div class="row-fluid">
    <div class="span12">
        <!-- BEGIN EXAMPLE TABLE PORTLET-->
        <div class="portlet box light-grey">
            <div class="portlet-title">
                <h4><i class="icon-group"></i>Danh mục khách hàng</h4>
                <div class="tools">
                    <a href="javascript:;" class="collapse"></a>
                </div>
            </div>
            <div class="portlet-body">
                
                <div class="clearfix">
                    <div class="btn-group">
                        <a href="/admin/customer/create"><button id="sample_editable_1_new" class="btn green">
                            Thêm mới <i class="icon-plus"></i>
                        </button></a>
                    </div>
                    <!--
                    <div class="btn-group pull-right">
                        <button class="btn red" type="button">
                            Xóa <i class="icon-trash"></i>
                        </button>
                    </div>
                    -->
                </div>
                
                <?php if(Yii::app()->user->hasFlash('error')):?>
                    <div class="alert alert-danger">
                        <?php echo Yii::app()->user->getFlash('error'); ?>
                    </div>
                <?php endif; ?>
                <table class="table table-striped table-bordered table-hover" id="sample_1">
                    <thead>
                    <tr>
                        <th style="width:8px;"><input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes" /></th>
                        <th>Tên</th>
                        <th>Họ</th>
                        <th>Email</th>
                        <th>M.Khẩu</th>
                        <th>Địa chỉ</th>
                        <th>T.Phố</th>
                        <th>Bang</th>
                        <th>Mã vùng</th>
                        <th>Đ.thoại</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php $i = 1;
                    foreach ($model as $key => $data) { ?>
                    <tr class="<?php if($i / 2) { echo 'odd'; } else { echo 'even';}?> gradeX">
                        <td><input type="checkbox" class="checkboxes" value="1" /></td>
                        <td><?php echo $data['lastname'] ? $data['lastname'] : "&nbsp;"?></td>
                        <td><?php echo $data['firstname'] ? $data['firstname'] : "&nbsp;"?></td>
                        <td><?php echo $data['email'] ? $data['email']: "&nbsp;"?></td>
                        <td>**********</td>
                        <td><?php echo $data['street'] ? $data['street'] : "&nbsp;"?></td>
                        <td><?php echo $data['city'] ? $data['city'] : "&nbsp;"?></td>
                        <td><?php echo $data['city'] ? $data['state'] : "&nbsp;"?></td>
                        <td><?php echo $data['zipcode'] ? $data['zipcode'] : "&nbsp;"?></td>
                        <td><?php echo $data['phone'] ? $data['phone'] : "&nbsp;"?></td>
                        <td>
                            <a class="btn green mini" href="/admin/customer/update/id/<?php echo $data['id']?>"><i class="icon-pencil icon-white"></i></a>
                            <a class="btn red mini" href="/admin/customer/delete/id/<?php echo $data['id']?>"><i class=" icon-remove icon-white"></i></a>
                        </td>
                    </tr>
                    <?php } ?>
                    </tbody>
                </table>
                <?php if(count($model) > 0) {?>
                    <div class="row-fluid">
                        <div class="span6">
                            <!--<div class="dataTables_info" id="sample_1_info">Hiển thị 1 đến 2 của 2 kết quả</div>-->
                            <div class="dataTables_info" id="sample_1_info">Hiển thị <?php echo $pages->getCurrentPage()* $page_size +1;?> đến <?php echo ($item_count >= (($pages->getCurrentPage()+1) * $page_size))?($pages->getCurrentPage()+1) * $page_size : $item_count;?> của <?php echo $item_count?> kết quả</div>
                        </div>
                        <div class="span6">
                            <div class="dataTables_paginate paging_bootstrap pagination">
                                <?php
                                // the pagination widget with some options to mess
                                $this->widget('MyLinkPager', array(
                                    'currentPage' => $pages->getCurrentPage(),
                                    'itemCount' => $item_count,
                                    'pageSize' => $page_size,
                                    'maxButtonCount' => 5,
                                    'header' => '',
                                    'htmlOptions' => array('class' => 'pages'),
                                ));
                                ?>
                            </div>
                        </div>
                    </div>
                <?php }?>
            </div>
        </div>
        <!-- END EXAMPLE TABLE PORTLET-->
    </div>
</div>

<!-- END PAGE CONTENT-->
</div>
<!-- END PAGE CONTAINER-->